]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st-theme-node: Add new getter st_theme_node_get_letter_spacing
authorMario Sanchez Prada <mario@endlessm.com>
Fri, 13 Apr 2018 11:56:18 +0000 (12:56 +0100)
committerMarco Trevisan <mail@3v1n0.net>
Wed, 18 Apr 2018 00:14:04 +0000 (00:14 +0000)
This will be used by ClutterText-backed StWidgets to update their
list of PangoAttributes according to the letter-spacing property.

src/st/st-theme-node.c
src/st/st-theme-node.h

index 3739b93b4b42e020226aea114d7787dbeb7616af..fd2cdb084b8cd72f64be4aa44338b7f6c0c5dac3 100644 (file)
@@ -2545,6 +2545,28 @@ st_theme_node_get_text_align(StThemeNode *node)
   return ST_TEXT_ALIGN_LEFT;
 }
 
+/**
+ * st_theme_node_get_letter_spacing:
+ * @node: a #StThemeNode
+ *
+ * Gets the value for the letter-spacing style property, in pixels.
+ *
+ * Return value: the value of the letter-spacing property, if
+ *   found, or zero if such property has not been found.
+ */
+gdouble
+st_theme_node_get_letter_spacing (StThemeNode *node)
+{
+  gdouble spacing = 0.;
+
+  g_return_val_if_fail (ST_IS_THEME_NODE (node), spacing);
+
+  ensure_properties (node);
+
+  st_theme_node_lookup_length (node, "letter-spacing", FALSE, &spacing);
+  return spacing;
+}
+
 static gboolean
 font_family_from_terms (CRTerm *term,
                         char  **family)
index 940b97a383788bfeec0aa3a1615e079f75b7d9d8..08648e68af3611ca984ca90fe01112d506bbc492 100644 (file)
@@ -223,6 +223,8 @@ StTextDecoration st_theme_node_get_text_decoration (StThemeNode *node);
 
 StTextAlign st_theme_node_get_text_align (StThemeNode *node);
 
+double st_theme_node_get_letter_spacing (StThemeNode *node);
+
 /* Font rule processing is pretty complicated, so we just hardcode it
  * under the standard font/font-family/font-size/etc names. This means
  * you can't have multiple separate styled fonts for a single item,